import { core } from "./gameengine";
import { State, StateMachine } from "./stateMachine";
import { missionManager } from "./mission/MissionManager";
import { user } from "./user";

class Marshal extends StateMachine {

}

// export class MarshalLandingState extends State {
//
//     onEnter() {
//         core.loadScene('assets/scene/landing.scene.json');
//     }
//
//     onExit() {
//     }
// }

// export class MarshalGamingState extends State {
//
//     onEnter() {
//         // user.score = 0;
//         core.loadScene("assets/scene/entrance.scene.json");
//     }
//
//     onExit() {
//     }
// }

// export class MarshalConversationTestState extends State {
//
//     onEnter() {
//         core.loadScene("assets/scene/conversation.scene.json");
//     }
//
//     onExit() {
//     }
// }

export class MarshalItemTestState extends State {

    onEnter() {
        console.log("进入itemTest");

        // missionManager.loadConfig(() => {
        core.loadScene("assets/scene/test/tilemapDemo.scene.json");
        // user.addSceneRecord("assets/scene/tilemapDemo.scene.json");
        // })

    }

    onExit() {
    }
}

// export class MarshalMapTestState extends State {
//
//     onEnter() {
//         console.log("进入tielmapTest");
//         core.loadScene("assets/scene/hallway.scene.json");
//     }
//
//     onExit() {
//     }
// }

export class MarshalDemoState extends State {

    onEnter() {
        // missionManager.loadConfig(() => {
        core.loadScene("assets/scene/hallwayF1.scene.json");
        // })
    }

    onExit() {
    }
}

// export class MarshalLockerState extends State {
//
//     onEnter() {
//         core.loadScene("assets/scene/lockTest.scene.json");
//     }
//
//     onExit() {
//     }
// }

// export class MalshalChangeSceneTestState extends State  {
//     onEnter() {
//         missionManager.loadConfig(() => {
//             core.loadScene("assets/scene/wardB.scene.json");
//             // user.addSceneRecord("assets/scene/wardB.scene.json");
//         })
//     }
//
//     onExit() {
//     }
// }

export class MarshalStartState extends State {
    onEnter() {
        missionManager.loadConfig(() => {
            console.log("跳转场景");
            user.keys = [];
            user.useBagItems = [];
            user.limitedTimeMission = 0;
            console.log("背包：", user.keys, user.useBagItems);

            core.loadScene("assets/scene/start.scene.json");
        })
    }

    onExit() {
    }
}

export class MarshalConRoomAState extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        core.loadScene("assets/scene/conRoomA.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalConRoomBState extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        core.loadScene("assets/scene/conRoomB.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalDeadHouseState extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        user.limitedTimeMission = 6;
        core.loadScene("assets/scene/deadHouse.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalEntranceState extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        core.loadScene("assets/scene/entrance.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalHallState extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        core.loadScene("assets/scene/hall.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalHallwayF1State extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        user.limitedTimeMission = 8;
        core.loadScene("assets/scene/hallwayF1.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalHallwayF2State extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        user.limitedTimeMission = 0;
        core.loadScene("assets/scene/hallwayF2.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalOfficeState extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        core.loadScene("assets/scene/office.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalWardAState extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        user.limitedTimeMission = 7;
        core.loadScene("assets/scene/wardA.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalWardBState extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        core.loadScene("assets/scene/wardB.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalWardCState extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        core.loadScene("assets/scene/wardC.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalWcManState extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        core.loadScene("assets/scene/wcMan.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalWcWomanState extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        core.loadScene("assets/scene/wcWoman.scene.json");
        // })
    }

    onExit() {

    }

}

export class MarshalGateState extends State {
    onEnter() {
        // missionManager.loadConfig(() => {
        core.loadScene("assets/scene/gate.scene.json");
        // })
    }

    onExit() {

    }

}

export const marshal = new Marshal();